package iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author shenhan
 * @create 2020/4/10 16:22
 * @description
 */
public class InfoColleage implements College {
    List<Department> departments;

    public InfoColleage() {
        this.departments = new ArrayList<>();
        addDepartment("java专业", "Java专业");
        addDepartment("PhP专业", "PhP专业");
        addDepartment("Vue专业", "Vue专业");
        addDepartment("大数据专业", "大数据专业");
        addDepartment("Linux专业", "Linux专业");
    }

    @Override
    public String getName() {
        return "信息工程学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        final Department department = new Department(name, desc);
        departments.add(department);
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterator(departments);
    }
}
